import { createApp } from 'vue'
import pinia from './stores/index'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'
import router from './router'
import './assets/reset.css' 
import App from './App.vue'
import VueLazyload from 'vue-lazyload';
// 引入全局守卫
import './permission'
const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 注册全局组件
import HeaderModule from './components/header/header.vue'
app.component('HeaderModule',HeaderModule)
import FooterModule from './components/footer/footer.vue'
app.component('FooterModule',FooterModule)
// const loadimage = require('./assets/images/loadbg.jpg');
app.use(VueLazyload, {
  preLoad: 1.3,
  loading: '/public/images/follow_empty@3x.09121649.png',
  attempt: 1
})



app.use(router)
  .use(ElementPlus, {
    locale: zhCn,
  })
  .use(pinia)
  .mount('#app')
